package com.papercutting.platform.dto.request;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.validation.constraints.*;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 活动资讯请求
 */
@Data
public class NewsRequest implements Serializable {
    
    private static final long serialVersionUID = 1L;
    
    private Long id;
    
    @NotBlank(message = "标题不能为空")
    @Size(max = 200, message = "标题长度不能超过200个字符")
    private String title;
    
    @Size(max = 200, message = "副标题长度不能超过200个字符")
    private String subtitle;
    
    @Size(max = 500, message = "封面图片URL长度不能超过500个字符")
    private String coverImage;
    
    @Size(max = 500, message = "摘要长度不能超过500个字符")
    private String summary;
    
    private String content;
    
    @NotNull(message = "类型不能为空")
    @Min(value = 1, message = "类型值不正确")
    @Max(value = 3, message = "类型值不正确")
    private Integer type = 1;
    
    @Size(max = 200, message = "标签长度不能超过200个字符")
    private String tags;
    
    @Size(max = 50, message = "作者长度不能超过50个字符")
    private String author;
    
    @Size(max = 100, message = "来源长度不能超过100个字符")
    private String source;
    
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime publishTime;
    
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime eventStartTime;
    
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime eventEndTime;
    
    @Size(max = 200, message = "活动地点长度不能超过200个字符")
    private String eventLocation;
    
    @Min(value = 0, message = "排序号不能为负数")
    private Integer sortOrder = 0;
    
    @NotNull(message = "状态不能为空")
    @Min(value = 0, message = "状态值不正确")
    @Max(value = 2, message = "状态值不正确")
    private Integer status = 0;
    
    @NotNull(message = "推荐状态不能为空")
    private Boolean isRecommend = false;
    
    @NotNull(message = "置顶状态不能为空")
    private Boolean isTop = false;
}